package com.cold.demo.web.config.handlemapping;

import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerAdapter;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author: zyc
 */
//@Component
//public class MyHandlerAdapter extends AbstractHandlerMethodAdapter implements HandlerAdapter {
//
//    @Override
//    protected boolean supportsInternal(HandlerMethod handlerMethod) {
//        return handlerMethod instanceof MyHandlerMethod;
//    }
//
//    @Override
//    protected ModelAndView handleInternal(HttpServletRequest request, HttpServletResponse response, HandlerMethod handlerMethod) throws Exception {
//        MyHandlerMethod myHandlerMethod = (MyHandlerMethod) handlerMethod;
//        Object          returnValue     = myHandlerMethod.getMethod().invoke(myHandlerMethod.getBean(), myHandlerMethod.getRequest());
//        return null;
//    }
//
//    @Override
//    protected long getLastModifiedInternal(HttpServletRequest request, HandlerMethod handlerMethod) {
//        return 0;
//    }
//}
